package edi.dao;

import edi.entities.DocumentEntity;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
@Transactional
public class DocumentDaoImp extends HibernateCrudDao<DocumentEntity> implements DocumentDao {

	public DocumentDaoImp() {
		super(DocumentEntity.class);
	}

	@Override
	public List<DocumentEntity> findByName(String name) {
		return session().createQuery("from DocumentEntity where docName = :name").setString("name", name).list();
	}
}  